package com.javachamp.arithmetic;

public class ZeroDivision {

	public static void main(String[] args) {
		double var = -5.0D;
		try {
			// negative infinity
			var /= 0;	
			// message: "divide by zero" Arithmetic Exception is thrown
			System.out.println(5/0);	
		} catch (ArithmeticException e) {
			System.out.println(e.getMessage());
		} finally {
			System.out.println("finally: " + var);
		}
	}
	
}
